package org.dna.uimodel;

import java.io.Serializable;

import org.apache.wicket.Component;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.dna.wickwtui.MetroPage;

public class MenuItem implements Serializable {

    private static final long serialVersionUID = -6931354675773030747L;
    Class<? extends MetroPage> m_destination;
    String m_caption;

    public MenuItem(String caption, Class<? extends MetroPage> dest) {
        m_destination = dest;
        m_caption = caption;
    }

    public Class<? extends MetroPage> getLink() {
        return m_destination;
    }

    public String getCaption() {
        return m_caption;
    }

    public Component createMenu() {
        BookmarkablePageLink<MetroPage> link = new BookmarkablePageLink<MetroPage>("link", getLink());
        link.add(new Label("caption", getCaption()));
        return link;
    }
}
